import request from '@/utils/request';

export function query(query){//查询所有消息
  return request({
    url: '/message/query/',
    method: 'get',
    params: query //为消息类型typeId  与 state 已读未读
  });
};
export function send(query){//发送消息
  return request({
    url: '/websocket/send',
    method: 'post',
    data: query// 发送公告消息 message=xxxx&typeId=xxx , 私发消息 userId=xxx&message=xxxx&typeId=xxx
  });
};
export function noticeread(userid,query){//公告消息已读
  return request({
    url: '/notice/read/'+userid,//为userId，谁读取这条公告消息填谁
    method: 'get',
    params: query// 消息id=xxx
  });
};
export function messageread(query){//其他消息已读
  return request({
    url: '/message/read/'+query,//id为消息的id
    method: 'get',
  });
};
export function noticedelete(query){//删除公告消息
  return request({
    url: '/notice/delete/'+query,//为要删除的公告消息的id
    method: 'get',
  });
};
export function messagedelete(query){//删除其他消息
  return request({
    url: '/message/delete/'+query,//为要删除的消息的id
    method: 'get',
  });
};

